package com.zenith.yasoo.party;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;





@Entity
@Table(name="party_type")
public class PartyType {
	private static final long serialVersionUID = 1L;
	
	public static final String TYPE_PARTY_GROUP = "PARTY_GROUP";
	public static final String TYPE_PERSON = "PERSON";
	
	public PartyType() {}
	public PartyType(String partyTypeCode) {this.partyTypeCode = partyTypeCode;}
	
	private String partyTypeCode;
	private String partyTypeName;
	private PartyType parentPartyType;
	private String hasTable;

	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	@Id
	@Column(length=20)
	public String getPartyTypeCode() {
		return partyTypeCode;
	}
	@Column(length=20)
	public String getPartyTypeName() {return partyTypeName;}
	
	@OneToOne
	@JoinColumn(name="parentPartyTypeCode")
	public PartyType getParentPartyType() {return parentPartyType;}
	
	@Column(length=1)
	public String getHasTable() {return hasTable;}

	
	public void setPartyTypeCode(String partyTypeCode) {
		this.partyTypeCode = partyTypeCode;
	}

	public void setPartyTypeName(String partyTypeName) {
		this.partyTypeName = partyTypeName;
	}

	public void setParentPartyType(PartyType parentPartyType) {
		this.parentPartyType = parentPartyType;
	}

	public void setHasTable(String hasTable) {
		this.hasTable = hasTable;
	}
}
